#ifndef PACKET_H
#define PACKET_H

#include <stdint.h>

typedef struct
{
    uint8_t type;
} BasePacket;

typedef struct : public BasePacket
{
    int x;
    int y;
} UpdatePacket;

typedef struct : public BasePacket
{
    uint8_t param;
} CommandPacket;

namespace Protocol
{
    static const int maxPacketSize = sizeof(UpdatePacket);
    static const int minPacketSize = sizeof(BasePacket);

    static const int request    = 0;
    static const int control    = 1;
    static const int release    = 2;
    static const int update     = 3;
    static const int command    = 4;

    static const int up         = 5;
    static const int down       = 6;
    static const int right      = 7;
    static const int left       = 8;
}

#endif // PACKET_H
